package cn.xc.controller;

import cn.xc.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    //加载端口
    @Value("${server.port}")
    private int port;

    @RequestMapping(value = "/user/{id}",method = RequestMethod.GET)
    public User getById(@PathVariable("id")Long id){
        System.out.println(port);
        return new User(id,"萨瓦迪卡","Skgjhw"+port);
    }

}
